<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin:0
        }
        div{
            width:103px;
            height:33px;
            background:url(images/bg3.gif);
            float:left;
            margin-right: 1px;
            text-align: center;
            line-height: 33px;
            color:white;
        }
        .over{
            background:url(images/bg2.gif);
            color:hotpink;
        }
        .out{
            background:url(images/bg3.gif);
            color:yellow;
        }
    </style>
    <script>
        function doOver(obj){
            // obj.style.backgroundImage="url(images/bg2.gif)";
            // obj.style.color="green";
            obj.className="over";
        }
        function doOut(obj){
            // obj.style.backgroundImage="url(images/bg3.gif)";
            // obj.style.color="yellow";
            obj.className="out";
        }
    </script>
</head>
<body>
    <div onmouseover="doOver(this)" onmouseout="doOut(this)">咨询动态</div>
    <div onmouseover="doOver(this)" onmouseout="doOut(this)">产品世界</div>
    <div onmouseover="doOver(this)" onmouseout="doOut(this)">市场营销</div>
</body>
</html>